package textEnum;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Text {
    public static void main(String[] args) {
        try {
            Class<?> c1 = Class.forName("textEnum.TextEnum");
            Constructor<?> declaredConstructor =
                    c1.getDeclaredConstructor(String.class, int.class,
                    String.class, int.class);
            declaredConstructor.setAccessible(true);
            TextEnum textEnum = (TextEnum)
                    declaredConstructor.newInstance
                    ("Blue", 0, "zhaoliu", 12);
            System.out.println(textEnum);


        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        } catch (NoSuchMethodException e) {
            throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
}
